﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SetCube : MonoBehaviour
{
    // Start is called before the first frame update
    public Cubemap cubeMap01;
    public Cubemap cubeMap02;

    [Header("新手引导Timeline不要勾选")]
    public bool setOnEnable = false;
    
    void OnEnable()
    {
        if (setOnEnable)
        {
            SetMaterial();
        }
    }

    // Update is called once per frame
    public void SetMaterial()
    {
        if (cubeMap01!=null)
        {
            Shader.SetGlobalTexture("_CubeMap",cubeMap01);
        }
        if (cubeMap02!=null)
        {
            Shader.SetGlobalTexture("_CubeMapBlur",cubeMap02);
        }
    }
}
